<%content_for 'sidebar' do%>
	<div id="reservation_sidebar" style="position:absolute;">
		<%= render :partial => 'edit_reservation' %>
	</div>
	<div id="reservation_sidebar_shadow">
	</div>
<% end %>

<%= render :partial=>'schedule_browser' %>

<script type="text/javascript">
      function autoposition_reservation_sidebar(){
         $("reservation_sidebar").style.top = "160px";
         sc = getPageScroll()
         if(sc[1]>160){
             $("reservation_sidebar").style.top = sc[1]+"px";                    
         }
		if(getPageSize()[1]<Element.getHeight('reservation_sidebar')+sc[1]){
            $("reservation_sidebar").style.top = (getPageSize()[1]-Element.getHeight('reservation_sidebar'))+"px";                    			
		}
      }

     if (window.addEventListener) {
         window.addEventListener("scroll", function (e) { autoposition_reservation_sidebar(); }, false);
     } else if (window.attachEvent) {
         window.attachEvent('on' + "scroll", function (e) { autoposition_reservation_sidebar(); });
     }

	new PeriodicalExecuter(function(){$('reservation_sidebar_shadow').style.height = Element.getHeight('reservation_sidebar') + 'px'},1)
 </script>
